package com.sss.hloster0303;

public class Student {
//属性
	// 成员变量
	private String stuName;
	private String stuSex;
	private double stuScore;

	// 行为
	/**
	 * 学习行为
	 */
	public void doStuding() {
		System.out.println(this.stuName + "  is   studing..........");
	}

//使用内部类输出学生的家庭成员信息
	public void printMeInfo() {
		//局部变量
		/*
		 * 如果该局部变量被局部内部类使用，则在jdk1.8之前需要使用final修饰，1.8+之后不需要使用final修饰；
		 */
		int stuAge=20;
		// 局部内部类：如果是private 只能是本类使用
		class StuFamily {
			// 属性
			private String stuMatherName;
			private String stuFatherName;
			private String stuFamilyAddress;

			// 行为
			/**
			 * 获取学生家庭信息行为
			 */
			public String getStuFamilyInfo() {
				// 局部内部类可以直接访问外部类的成员变量和成员方法
				/*
				 * 在局部内部类中使用外部局部变量 stuAge的值
				 * 如果该局部变量被局部内部类使用，则在jdk1.8之前需要使用final修饰，1.8+之后不需要使用final修饰；
				 */
				 
				String str = "学生：：" + stuName + "的家庭信息为：：" + this.toString();
				return str;
			}

			public StuFamily(String stuMatherName, String stuFatherName, String stuFamilyAddress) {
				super();
				this.stuMatherName = stuMatherName;
				this.stuFatherName = stuFatherName;
				this.stuFamilyAddress = stuFamilyAddress;
			}

			public String getStuMatherName() {
				return stuMatherName;
			}

			public void setStuMatherName(String stuMatherName) {
				this.stuMatherName = stuMatherName;
			}

			public String getStuFatherName() {
				return stuFatherName;
			}

			public void setStuFatherName(String stuFatherName) {
				this.stuFatherName = stuFatherName;
			}

			public String getStuFamilyAddress() {
				return stuFamilyAddress;
			}

			public void setStuFamilyAddress(String stuFamilyAddress) {
				this.stuFamilyAddress = stuFamilyAddress;
			}

			public String toString() {
				return "StuFamily[stuMatherName=  " + stuMatherName + "  ,stuFather=" + stuFatherName
						+ "   , stuFamilyAddress=  " + stuFamilyAddress + "]";

			}

		}

		StuFamily stuF = new StuFamily("张三妈妈", "张三爸爸", "天津西青");
		System.out.println(stuF.getStuFamilyInfo());
	}

	public Student(String stuName, String stuSex, double stuScore) {
		super();
		this.stuName = stuName;
		this.stuSex = stuSex;
		this.stuScore = stuScore;
	}

	public Student() {
		super();
	}

	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public String getStuSex() {
		return stuSex;
	}

	public void setStuSex(String stuSex) {
		this.stuSex = stuSex;
	}

	public double getStuScore() {
		return stuScore;
	}

	public void setStuScore(double stuScore) {
		this.stuScore = stuScore;
	}

}
